import Toolbar from "@/components/ViewComponents/Toolbar";
import "./index.less";
import { BasicForm, FormSchema, useForm } from "@/components/Form";
import { Tabs } from "antd";
const { TabPane } = Tabs;
import MedicalRecord from "./components/medicalRecord/index";
import { useTranslation } from "react-i18next";
const index = () => {
	const { t } = useTranslation();
	const en_vi = "Hospitalization.additionalImages";
	const herderSchemas: FormSchema[] = [
		{
			label: t(`${en_vi}.medicalRecord`),
			field: "MedicalRecord", // 病历
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.patientId`),
			field: "PatientID", //病人代码
			component: "Input"
		},
		{
			label: t(`${en_vi}.fullName`),
			field: "Name", //姓名
			component: "Input"
		},
		{
			label: t(`${en_vi}.yearOfBirth`),
			field: "YearOfBirth", //出生年份
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.gender`),
			field: "Gender", //性别
			component: "Select"
		},
		{
			label: t(`${en_vi}.address`),
			field: "Address", //地址
			component: "Input"
		},
		{
			label: t(`${en_vi}.admissionDate`),
			field: "AdmissionDate", //入院日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.cardNumber`),
			field: "CardNumber", //卡号
			component: "Input"
		},
		{
			label: t(`${en_vi}.room`),
			field: "Room", // 房间
			component: "Input"
		},
		{
			label: t(`${en_vi}.bed`),
			field: "Bed", // 床位
			component: "Input"
		},
		{
			label: t(`${en_vi}.diagnosis`),
			field: "Diagnosis", // 诊断
			component: "Input"
		}
	];
	const [herderRegister] = useForm({
		schemas: herderSchemas,
		labelWidth: 120,
		baseColProps: {
			span: 4
		}
	});
	const handlerToolbarAction = (key: string) => {
		console.log(key);
	};
	const onChange = (key: string) => {
		console.log(key);
	};
	return (
		<div className="page">
			<div className="page-content additionalImages">
				<div className="block additionalImages_herder">
					<BasicForm register={herderRegister}></BasicForm>
				</div>
				<div className="block additionalImages_content flex">
					<div className="additionalImages_content_left"></div>
					<div className="additionalImages_content_right">
						<Tabs defaultActiveKey="1" style={{ height: "100%" }} onChange={onChange}>
							<TabPane tab={"Tang1"} key={1}>
								<MedicalRecord></MedicalRecord>
							</TabPane>
							<TabPane tab={"Tang2"} key={2}>
								tang2
							</TabPane>
						</Tabs>
					</div>
				</div>
			</div>
			<Toolbar action={handlerToolbarAction} btnList={["save"]} />
		</div>
	);
};
export default index;
